package com.fita.wechat.dao;

import java.util.Date;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.data.Country;
import com.fita.entity.data.CountryCoupon;

/**
 * 
 * @author dan
 *
 */
@Dao("hibernate")
public interface CountryCouponDao {
    
    /**
     * 
     * @param country
     * @param currentDate
     * @return
     */
    @Query("FROM CountryCoupon WHERE disabled = false AND country = :country AND active = true AND effectiveStartDate <= :currentDate AND effectiveEndDate >= :currentDate")
    public CountryCoupon load(@Variable("country") Country country, @Variable("currentDate") Date currentDate);
  
  
}
